/*
 * Copyright (c) 2006, 2023, webrx.cn All rights reserved.
 *
 */

package cn.webrx;

import java.util.Random;
import java.util.function.Function;
import java.util.stream.IntStream;

/**
 * <p>Project: jse2303 - Lam01
 * <p>Powered by webrx On 2023-07-25 11:38:09
 * <p>描述：<p>
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Lam01 {
    public static void main(String[] args) {
        Num n = i -> i * i;
        System.out.println(n.pf(6));
        Random rand = new Random();

        //IntStream is = IntStream.generate(() -> rand.nextInt(1, 101)).limit(5);


        //is.forEach(System.out::println);

        //is.forEach(e -> {
        //    System.out.printf("%03d ", e);
        //});

        Function<Integer, Integer> f = i -> i * i;
        System.out.println(f.apply(6));

        int sum = IntStream.rangeClosed(1, 100).sum();
        System.out.printf("1+2+3+...+100 = %d", sum);


    }
}
